//
//  IdentifyPhoneNumberViewController.m
//  拉勾7.17
//
//  Created by 殷殷明静 on 16/7/18.
//  Copyright © 2016年 YMJ. All rights reserved.
//

#import "IdentifyPhoneNumberViewController.h"

@interface IdentifyPhoneNumberViewController ()

@end

@implementation IdentifyPhoneNumberViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    // 返回iconAndButton
    self.backButton = [UIButton buttonWithType:UIButtonTypeCustom];
    _backButton.frame = CGRectMake(0, 0, 100, 50);
    [_backButton setTitle:@"返回" forState:0];
    [_backButton setImage:[UIImage imageNamed:@"icon_back@##3x"] forState:0];
    _backButton.titleLabel.font = [UIFont italicSystemFontOfSize:20];
    [_backButton setTitleColor:COLOR1 forState:0];
    [self.view addSubview:_backButton];
    [_backButton setImageEdgeInsets:UIEdgeInsetsMake(0, 5, 0, -5)];
    // 验证手机label
    self.identifyPhoneNumberLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 88, 20)];
    _identifyPhoneNumberLabel.center = CGPointMake(WIDTH / 2, 100);
    _identifyPhoneNumberLabel.text= @"验证手机";
    _identifyPhoneNumberLabel.textColor = [UIColor blackColor];
    _identifyPhoneNumberLabel.font = [UIFont italicSystemFontOfSize:22];
    [self.view addSubview:_identifyPhoneNumberLabel];
    // 输入手机号
    self.phoneNumberTextField = [CustomTextField createPhoneNumbertextField];
    [self.view addSubview:_phoneNumberTextField];
    // 输入验证码
    self.identifyIconTextField = [CustomIdentifyPhoneNumberTextField createIdentifyIconTextField];
    [self.view addSubview:_identifyIconTextField];
    // 签协议
    self.phoneNumberTextField.delegate = self;
    self.identifyIconTextField.delegate = self;
    // 划两条线
    UIView *firstLine = [[UIView alloc] initWithFrame:CGRectMake(20, 170, WIDTH - 40, 1.5)];
    [self.view addSubview:firstLine];
    firstLine.backgroundColor = [UIColor lightGrayColor];
    UIView *secondLine = [[UIView alloc] initWithFrame:CGRectMake(20, 170 + 56, WIDTH - 40, 1.5)];
    [self.view addSubview:secondLine];
    secondLine.backgroundColor = [UIColor lightGrayColor];
    // 下一步nextStepButton
    self.nextStepButton = [UIButton createNextStepButton];
    [self.view addSubview:_nextStepButton];
    // 邮箱用户找回密码,请
    UILabel *findPaswordLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, 736 / 2 + 28, (WIDTH - 40) / 2 - 10, 50)];
    findPaswordLabel.text = @"邮箱用户找回密码,请";
    findPaswordLabel.font = [UIFont italicSystemFontOfSize:19];
    findPaswordLabel.backgroundColor = [UIColor clearColor];
    findPaswordLabel.textColor = [UIColor darkGrayColor];
    [self.view addSubview:findPaswordLabel];
    // 点击这里btton
    self.clickHereButton = [UIButton createClickHereButton];
    [self.view addSubview:_clickHereButton];
    // 返回button 事件
    [self backToRootVC];
}
- (void)back {
    CATransition *animation = [CATransition animation];
    animation.timingFunction = UIViewAnimationCurveEaseInOut;
    animation.duration = 0.3;
    animation.type = kCATransitionPush;
    animation.subtype = kCATransitionFromLeft;
    [self.view.window.layer addAnimation:animation forKey:@"尼玛"];
    [self dismissViewControllerAnimated:NO completion:^{
        
        
    }];
//    [self.navigationController popViewControllerAnimated:YES];
}
- (void)backToRootVC {
    [self.backButton addTarget:self action:@selector(back) forControlEvents:UIControlEventTouchUpInside];
}
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
    [textField resignFirstResponder];
    return YES;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
